//
//  SKYApplication.m
//  SkyonSDK
//
//  Created by macbook on 2018/5/6.
//  Copyright © 2018年 Skyon. All rights reserved.
//

#import "SKYApplication.h"

@implementation SKYApplication

// 共享实例
+ (instancetype)sharedInstance {
    static SKYApplication *_instance;
    static dispatch_once_t onceInstance;
    dispatch_once(&onceInstance, ^{
        _instance = [[SKYApplication alloc] init];
    });
    return _instance;
}

// 设置渠道对应的appkey
- (void)setAppKey:(NSString *)appKey {
    self.skyAppKey = appKey;
}

// 获取渠道对应的appkey
- (NSString *)getAppKey {
    return self.skyAppKey;
}

// 应用名称
+ (NSString *)getAppName {
    NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
    return [infoDictionary objectForKey:@"CFBundleName"];
}

// 应用的包名
+ (NSString *)getAppPackageName {
    NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
    return [infoDictionary objectForKey:@"CFBundleIdentifier"];
}

// 应用版本号
+ (NSString *)getAppVersion {
    NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary];
    return [infoDictionary objectForKey:@"CFBundleShortVersionString"];
}



@end
